<?php
namespace app\common\CoreCalculate;

//工具类
class Tree {

    //传递一个父级ID返回所有子集的LIST
    Public function getChilds($cate,$pid){
        $arr = array();
        foreach($cate as $v){
            if($v['pid'] == $pid){
                $arr[] = $v;
                $arr = array_merge($arr,self::getChildsId($cate,$v['id']));
            }
        }
        return $arr;
    }

}


?>